#ifndef _LOGIN_VERIFY_TASK_H_
#define _LOGIN_VERIFY_TASK_H_

#include "task.h"
#include "qbprotocol/include/ssCmnDefine.h"
#include "qbprotocol/include/rdClientLocal.h"

namespace qb
{
    // 登录到LoginServer进行验证的任务
    class CLoginVerifyTask
        : public CTask
    {
    public:
        CLoginVerifyTask();
        ~CLoginVerifyTask();

	protected:
		virtual void StartImpl();
		virtual void TerminateImpl();
        virtual bool IsConnectTask() { return false; }
		virtual void OnNetData(char* pRecvData, int nDataLen);
        virtual void OnNetStatus(int32_t status) {}
        virtual int32_t GetTaskTimeout() { return LOGIN_VERIFY_TIMEOUT; }

        void makeLoginData(char* buf, int& buflen);
        int32_t porcessLoginQPIDMessage(const xMessageInfo_t& data, const xMsgHeadAck_t& xHead);
        void handle_ReqUserLogout();

    private:
        xMessageInfo_t  m_data;
        xMsgHeadAck_t   m_HeadAck;
        unsigned char   QB_Key[32];

        static bool     m_bFirst;
    };
}

#endif
